import Vue from 'vue'
import Router from 'vue-router'
/**
 * 组件使用懒加载方式书写
 * const Home = () => import('@/views/Home.vue')
 * 正常加载
 * import Home from '@/views/Home.vue'
 *  */
const Home = () => import('@/views/Home.vue')
const Demo = () => import('@/views/demo/lottery.vue')

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/demo',
      name: 'demo',
      component: Demo
    }
  ]
})
